﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MotionCS.Controller
{
    public interface IDiBit
    {
        /// <summary>
        /// 标识符
        /// </summary>
        int Identity { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        string Name { get; set; }
        /// <summary>
        /// 输入口
        /// </summary>
        ushort Index { get;}
        /// <summary>
        /// 是否导通
        /// </summary>
        bool IsOn();
        /// <summary>
        /// 是否断开
        /// </summary>
        bool IsOff();
        /// <summary>
        /// 输入值
        /// </summary>
        /// <returns></returns>
        int Inbit();
    }

    public interface IDoBit
    {
        /// <summary>
        /// 标识符
        /// </summary>
        int Identity { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        string Name { get; set; }
        /// <summary>
        /// 输出口
        /// </summary>
        ushort Index { get;}
        /// <summary>
        /// 导通
        /// </summary>
        void TurnOn();
        /// <summary>
        /// 断开
        /// </summary>
        void TurnOff();
        /// <summary>
        /// 输出值
        /// </summary>
        /// <returns></returns>
        void SetOut(uint val);
        /// <summary>
        /// 是否导通
        /// </summary>
        bool IsTurnOn();
    }
}
